package ljm.server;

import java.rmi.Naming;
import java.rmi.registry.LocateRegistry;


//先运行服务端
public class ServerMain {
    public static void main(String[] args) throws Exception {

        // 创建RMI注册
        LocateRegistry.createRegistry(8888);
        // 绑定远程对象
        Server server = new ServerImpl();
        //把远程对象实例注册到 RMI 注册服务器上
        Naming.bind("rmi://localhost:8888/Server", server);
        System.out.println("PS:服务启动中");
    }
}
